<script>
const app = getApp();
export default {
  name: "note-list-item",
  props: {
    shopsLists: {
      type: Array,
      default: []
    },
  },
  data() {
    return {
      baseUrl: app.globalData.baseUrl,
      isTabActive: true,
      isTabDate: false,
      startTime: '',
      endTime: '',
    }
  },
  mounted() {

  },
  methods: {
    //获取图片的第一张
    packageimage(data) {
      return data[0]
    },
    //订单详情
    goToDetail(res) {
      console.log('查看套餐', res);
      if(res.source === 1){
        // #ifdef MP-WEIXIN
        uni.navigateTo({
          url: '/subPackagePurse/note-list/note-details?id=' + res.id + '&shop_name=' + res.shop_name
        })
        // #endif
        // #ifdef H5
        uni.navigateTo({
          url: '/pages/noteListH5/note-details?id=' + res.id + '&shop_name=' + res.shop_name
        })
        // #endif
      } else {
        // #ifdef MP-WEIXIN
        uni.navigateTo({
          url: '/subPackagePurse/note-list/task-note-list?id=' + res.id + '&shop_name=' + res.shop_name
        })
        // #endif
        // #ifdef H5
        uni.navigateTo({
          url: '/pages/noteListH5/note-details?id=' + res.id + '&shop_name=' + res.shop_name
        })
        // #endif
      }

    },
  }
}

</script>

<template>
  <view>
    <view class="shop-list-item" v-for="(item,index) in shopsLists" :key="index" @click="goToDetail(item)">
      <view class="shop-list-item-top">
        <view><text style="color: #666666">时间：</text><text style="color: #3D3D3D">{{item.notes_date}}</text></view>
        <view style="color: #FF7900"><text>共计完成：</text><text>{{item.notes_num}}</text><u-icon name="arrow-right" size="24" color="#B5B5B5"></u-icon></view>
      </view>
      <u-line color="#EEEEEE"></u-line>
      <view class="shop-list-item-bottom">
        <view class="shop-list-item-img">
          <image :src="item.shop_logo" mode="aspectFill"></image>
        </view>
        <view class="shop-list-item-right">
          <view class="shop-list-item-title ellipsis-one-line">{{item.shop_name}}</view>
          <view class="shop-list-item-subt ellipsis-two-line">笔记不满意？ | 可联系服务群内业务经理修改笔记</view>
          <view>
            <timer :time="endTime" @end="onTimerEnd"></timer>
          </view>
          <!--<view class="shop-list-item-plat">
            <text>笔记平台：</text>
            <view style="display: flex;">
              <image :src="item.platform_type.image" style="width: 40rpx;height: 40rpx;border-radius: 50%;margin-right: 10rpx;"></image>
              <text>{{item.platform_type.title}}</text>
            </view>
          </view>-->
        </view>
      </view>
    </view>

  </view>
</template>

<style>

</style>